﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MaLu.Common;
using MaLu.BusiLogic;
using System.Data;

namespace MaluJg.web.Stats02.financial
{
    public partial class DetailList : FarmerPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }

        protected void pgList_OnPreRender(object sender, EventArgs e)
        {

            BindData();

        }
        private void BindData()
        {
            string where = "year="+Year +" and Village='"+VillageName+"'";
            int recordcount = 0;
            DataTable dt = BLCommon.GetPagingList(Provider, @"*", "FaShare", where, "Place,FamilyName", pgList.PageIndex + 1, 20, false, 0, ref recordcount);
            foreach (DataRow item in dt.Rows)
            {
                item["HongliPercent"] = float.Parse(item["HongliPercent"].ToString()).ToString("f2");
            }


            pgList.RecordCount = recordcount;

            rptList.DataSource = dt;
            rptList.DataBind();


        }
        public string  VillageName
        {
            get
            {

                return HttpUtility.UrlDecode(Request["v"] ?? string.Empty);
            }

        }
    }
}
